package com.example.cloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

import feign.Logger;

/**
 * Feign实现接口消费
 *
 * @author tongyufu
 */
@EnableFeignClients
//启动客户端发现
@EnableDiscoveryClient
@SpringBootApplication
public class FeignConsumerCloudApplication {

    /**
     * Feign实现接口消费
     *
     * @param args 启动参数
     */
    public static void main(String[] args) {
        SpringApplication.run(FeignConsumerCloudApplication.class, args);
    }

    /**
     * 开启服务的调试日志，默认Level为NONE
     *
     * @return Level
     */
    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }
}
